URL = "http://protobuf.googlecode.com/files/protobuf-%(VERSION)s.tar.gz"
VERSIONS = ["2.4.1"]
DEFAULT_VERSION = "2.4.1"
DEPENDS = ["python", "protobuf"]

from source.builders import PythonPackageBuilder
import os,shutil

class PyProtoBufBuilder( PythonPackageBuilder ):
  """ subclass of VisualStudioBuilder with customized steps """

  def configure(self):
    # Rename Debug directory to make sure the Release version is run.
    src = os.path.join(self.extractedpath, "vsprojects", "Debug")
    tgt = os.path.join(self.extractedpath, "vsprojects", "OldDebug")
    if os.path.exists( src ):
      if os.path.exists( tgt ):
        shutil.rmtree( tgt )
      os.rename(src, tgt)

    super( PyProtoBufBuilder, self).configure()
    self.extractedpath = os.path.join(self.extractedpath, "python")

  #def archivepath(self):
    #return os.path.join( self.runtime.config.directories.download, self.runtime.url.packagearchive(), "python" )

  def targetpath(self):
    return os.path.join( self.runtime.config.directories.enviro, "pyprotobuf" )
    
  def hasdebug(self):
    return False

    
    

BUILDER = PyProtoBufBuilder

